//
//  WHPayCell.m
//  BinFengExpressOwner
//
//  Created by 邓伟浩 on 2018/10/30.
//  Copyright © 2018年 BinFeng. All rights reserved.
//

#import "WHPayCell.h"

@interface WHPayCell ()

@property (nonatomic, strong) UIButton *rightTipsButton;

@end

@implementation WHPayCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self setUpUI];
    }
    return self;
}

- (void)setUpUI {
    [self.contentView addSubview:({
        _tipsImageView = [[UIImageView alloc] init];
        _tipsImageView.contentMode = UIViewContentModeScaleAspectFit;
        
        _tipsImageView;
    })];
    [_tipsImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.height.mas_offset(kRealwidth(45));
        make.centerY.mas_equalTo(self.contentView.mas_centerY);
        make.left.mas_equalTo(self.contentView.mas_left).offset(kRealwidth(15));
    }];
    
    [self.contentView addSubview:({
        _tipsLabel = [[UILabel alloc] init];
        _tipsLabel.textColor = CFontTitleBlackColor;
        _tipsLabel.font = SYSTEMFONT(kRealwidth(16));
        
        _tipsLabel;
    })];
    [_tipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.mas_offset(kRealwidth(16));
        make.top.mas_equalTo(self.contentView.mas_top).offset(kRealwidth(15));
        make.left.mas_equalTo(_tipsImageView.mas_right).offset(kRealwidth(28));
    }];
    
    [self.contentView addSubview:({
        _descriptionLabel = [[UILabel alloc] init];
        _descriptionLabel.textColor = CFontContentLightGrayColor;
        _descriptionLabel.font = SYSTEMFONT(kRealwidth(15));
        
        _descriptionLabel;
    })];
    [_descriptionLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.mas_offset(kRealwidth(15));
        make.top.mas_equalTo(_tipsLabel.mas_bottom).offset(kRealwidth(15));
        make.left.mas_equalTo(_tipsImageView.mas_right).offset(kRealwidth(28));
    }];
    
    [self.contentView addSubview:({
        _rightTipsButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [_rightTipsButton setImage:IMAGE_NAMED(@"sendOrder_typeUnSelected_icon") forState:UIControlStateNormal];
        [_rightTipsButton setImage:IMAGE_NAMED(@"sendOrder_typeSelected_icon") forState:UIControlStateSelected];
        _rightTipsButton.userInteractionEnabled = NO;
        _rightTipsButton;
    })];
    [_rightTipsButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.contentView.mas_centerY);
        make.right.mas_equalTo(self.contentView.mas_right).offset(-kRealwidth(15));
        make.width.height.mas_equalTo(kRealwidth(16));
    }];
}

- (void)setRightButtonSelect:(BOOL)rightButtonSelect {
    if (rightButtonSelect) {
        _rightTipsButton.selected = YES;
    } else {
        _rightTipsButton.selected = NO;
    }
}

@end
